//PURPOSE: Force Upper Case Letters
//USAGE: onkeyup="return ForceUpperCase()" 
function ForceUpperCase(txt)
{   txt.value = txt.value.toUpperCase();    }


//PURPOSE: Prevent alphanumeric chars being typed in (including fullstop)
//USAGE: onKeyPress="return ValidateInteger()" 
function ValidateInteger()
{
	var ASCII = event.keyCode;
	if  (ASCII == 45)                   {   return true;    } //189=neg. sign
	if ((ASCII >= 48)&&(ASCII <= 57))   {	return true;	} //(0-9)=(48-57)
	return false;
}

//PURPOSE: Prevent alphanumeric chars being typed in (excluding fullstop)
//USAGE: onKeyPress="return ValidateNumber()" 
function ValidateNumber()
{
	var ASCII = event.keyCode;
	if  (ASCII == 45)                   {   return true;    } //189=neg. sign
	if  (ASCII == 46)                   {   return true;    } //46=dec. point
	if ((ASCII >= 48)&&(ASCII <= 57))   {	return true;	} //(0-9)=(48-57)
	return false;
}

//PURPOSE: Allow up/down arrow keys to increment a number field
//USAGE: onKeyPress="ChangeNumber(this)"
function ChangeNumber(txt)
{
	if (38 == event.keyCode)
	{	try	{	txt.value = parseInt(txt.value)+1;	txt.select();	}	catch(e){;}	}
	if (40 == event.keyCode)
	{	try	{	txt.value = parseInt(txt.value)-1;	txt.select();	}	catch(e){;}	}
}

//PURPOSE: Force a number to be greater than zero
//USAGE: onBlur="BlurWholeNumber(this)"
function BlurWholeNumber(txt)
{	
	try	{	if (txt.value == '')			{	txt.value = 0;	}	}	catch (e) 	{	;	}
	try	{	if (parseInt(txt.value) < 0)	{	txt.value = 0;	}	}	catch (e) 	{	;	}
}
